<script type="text/javascript">

</script>
<div class="causes form">
<?php $this->Html->script('prototype', array('inline' => false));?>
<?php echo $this->Form->create('Cause');?>
	<fieldset>
        <legend><?php __('Edit Cause'); ?></legend>
	<?php
		echo $this->Form->input('id');
                echo $this->Form->input('jurisdiction_id',array('id'=>'jurisdiction','type'=>'select','label'=>'Jurisdicción','options'=>array($jurisdictions),'selected'=>$charters['0']['Charter']['jurisdictions_id'],'onChange'=>'showFields(this.value)'));
                if($charters['0']['Charter']['jurisdictions_id']==2){
                     $mostrar = 'display:block';
                     $selected = $charters['0']['Charter']['jurisdictions_id'];
               }else{$mostrar='display:none';
                     $selected = "--Seleccione--";   
               }?>
                <?php echo $this->Form->input('provinces_id',array('label'=>'Provincia','id'=>'provinces','type'=>'select','selected'=>$selected));
                echo $this->Form->input('charters_id',array('id'=>'charters','type'=>'select','label'=>'Fuero','options'=>array($charters['0']['Charter']['descripcion'])));    ?>
                <?php 
		echo $this->Form->input('placements_id',array('id'=>'placements','type'=>'select','label'=>'Dpto. Judicial o Circunscripción','options'=>array($placements['0']['Placement']['descripcion']),'id'=>'placements'));
?><div>-</div><?php
                
                echo $this->Form->input('courts_id',array('id'=>'courts','type'=>'select','label'=>'Juzgado','options'=>array($courts['0']['Court']['descripcion'])));
                echo $this->Form->input('secretaries_id',array('id'=>'secretaries','label'=>'Secretaría'));
                echo $this->Form->input('police_stations_id',array('label'=>'Dependencia Policial'));
           
		echo $this->Form->input('nro_causa',array('label'=>'Nº de Causa'));
                echo $this->Form->input('descripcion',array('label'=>'Descripción'));
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit', true));
    $options2 = array('url' => 'update_charters', 'update' => 'charters');
    echo $ajax->observeField('provinces', $options2);
    
     $options3 = array('url' => 'update_provinces', 'update' => 'provinces');
    echo $ajax->observeField('jurisdiction',$options3);
    
    $options4 = array('url' => 'update_placements', 'update' => 'placements');
    echo $ajax->observeField('charters',$options4);
    
    $options5 = array('url' => 'update_courts', 'update' => 'courts');
    echo $ajax->observeField('charters',$options5);
    
    $options6 = array('url' => 'update_secretaries', 'update' => 'secretaries');
    echo $ajax->observeField('courts',$options6);
?>
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>

		<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Cause.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Cause.id'))); ?></li>
		<li><?php echo $this->Html->link(__('List Causes', true), array('action' => 'index'));?></li>
		<li><?php echo $this->Html->link(__('List Police Stations', true), array('controller' => 'police_stations', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Police Stations', true), array('controller' => 'police_stations', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Secretaries', true), array('controller' => 'secretaries', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Secretaries', true), array('controller' => 'secretaries', 'action' => 'add')); ?> </li>
	</ul>
</div>